<?php
class Admin_AjaxController extends Zend_Controller_Action{
	public function init(){
		$this->view->layout()->disableLayout();
	}
	public function getfiltersAction(){
		
		//lấy mã category được gửi về
		$category_id = $this->getRequest()->getParam('cat_id');
		$product_id = $this->getRequest()->getParam('product_id');
		if(is_numeric($category_id)){
			$pCategoryModel = new Model_PCategory();
			$productModel = new Model_Product();
			$pCategory = $pCategoryModel->getCategoryByID($category_id);
			$this->view->arrFilters = $pCategory->findManyToManyRowset('Model_Filter', 'Model_CategoryFilter');
			$this->view->product = $productModel->getProductByID($product_id);
		}
	}
	public function pageslugAction(){
		$page_id  = $this->getRequest()->getParam('page_id');
		if(is_numeric($page_id)){
			$pageModel = new Model_Post();
			$page = $pageModel->getPostByID($page_id);
			$this->view->page = $page;
		}
	}
}